Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dashboard #4330

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open

New dashboard #4330

wants to merge 28 commits into from

Conversation

srugano
Copy link
Contributor

@srugano srugano commented Oct 15, 2024

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 77.72021% with 43 lines in your changes missing coverage. Please review.

Project coverage is 55.05%. Comparing base (6ef7a33) to head (1a824d1).

Files with missing lines Patch % Lines
src/hct_mis_api/apps/dashboard/celery_tasks.py 53.12% 15 Missing ⚠️
src/hct_mis_api/apps/dashboard/views.py 75.00% 15 Missing ⚠️
src/hct_mis_api/apps/dashboard/services.py 80.00% 11 Missing ⚠️
src/hct_mis_api/config/settings.py 88.88% 1 Missing ⚠️
src/hct_mis_api/middlewares/xframe.py 90.90% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (6ef7a33) and HEAD (1a824d1). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (6ef7a33) HEAD (1a824d1)
unittests 2 0
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #4330       +/-   ##
============================================
- Coverage    77.59%   55.05%   -22.55%     
============================================
  Files          944      950        +6     
  Lines        44624    44620        -4     
============================================
- Hits         34628    24564    -10064     
- Misses        9996    20056    +10060     
Flag Coverage Δ
e2e 55.05% <77.72%> (+7.44%) ⬆️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@srugano srugano marked this pull request as ready for review October 22, 2024 01:06
@mmaciekk mmaciekk added frontend Changes in FE code backend Changes in BE code labels Oct 30, 2024
@domdinicola
Copy link
Collaborator

@srugano regenerate lock

@domdinicola
Copy link
Collaborator

@srugano regenerate pdm

@srugano srugano requested a review from mmaciekk November 3, 2024 05:53
assert "0" in pageCountryDashboard.getTotalNumberOfFeedback().text
assert "USD 0.00" in pageCountryDashboard.getTotalAmountTransferred().text
pageCountryDashboard.switch_to_dashboard_iframe()
# assert pageCountryDashboard.get_total_amount_paid().text == "", "Expected total amount paid to be empty."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these tests commented out?

from typing import List, Optional

from django.http import HttpRequest, HttpResponse
from django.utils.deprecation import MiddlewareMixin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johniak, @MarekBiczysko Please check if this middleware is correct. I needed to overwrite the default django setting in order to display dashboard page in an iframe

pyproject.toml Outdated Show resolved Hide resolved
"""
Test that generate_dash_report_task refreshes data for the given business area.
"""
mock_refresh_data = mocker.patch.object(DashboardDataCache, "refresh_data")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong way to call patch.object. You are not patching an object here

mock_household_objects.using.return_value.filter.return_value = mock_households
mock_serializer.return_value.data = {"id": 1, "name": "test"}

with patch.object(DashboardDataCache, "store_data") as mock_store_data:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be done with monkeypatch and it is more correct in this case

assert "0" in pageCountryDashboard.getTotalNumberOfGrievances().text
assert "0" in pageCountryDashboard.getTotalNumberOfFeedback().text
assert "USD 0.00" in pageCountryDashboard.getTotalAmountTransferred().text
pageCountryDashboard.switch_to_dashboard_iframe()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these commented out lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still updating the figures

tests/unit/apps/dashboard/test_services.py Show resolved Hide resolved
@patch.object(DashboardDataCache, "refresh_data")
@patch("hct_mis_api.apps.core.models.BusinessArea.objects")
def test_update_dashboard_figures(
mock_business_area_objects: MagicMock, mock_refresh_data: MagicMock, afghanistan: BusinessArea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are these fixtures ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Changes in BE code frontend Changes in FE code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants